//测试
#include<iostream>
#include<string>
using namespace std;

void CutString(string& in,string out1,string out2,const char& sep)
{
    size_t pos = in.find(sep);
    if(pos != string::npos)
    {
        //找到了
        int t1,t2;
        t1 = t2 = 1;
        int i1 = 0,i2 = pos + 1;

        while(t1 == 1 || t2 == 1)
        {
            if(t1 == 1)
            {
                if(i1 == pos) t1 = 0;
                else out1 += in[i1++];
            }
            if(t2 == 1)
            {
                if(i2 == in.size())t2 = 0;
                else out2 += in[i2++];
            }
        }
        cout << out1 << endl << out2 << endl;
    }
}

int main()
{
    string s("k&y");
    //cin >> s;
    string k1,v1;
    CutString(s,k1,v1,'&');

    return 0;
}
